﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace _20160627AJAX项目学习._01汇率计算JQAJAX
{
    /// <summary>
    /// HuiLv 的摘要说明
    /// </summary>
    public class HuiLv : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string amount = context.Request["amount"];
            string moneytype = context.Request["moneytype"];
            int iAmount = Convert.ToInt32(amount);

            if (moneytype == "1")
            {
                context.Response.Write(iAmount/7);
            }
            else if (moneytype == "2")
            {
                context.Response.Write(iAmount*10);
            }
            else if (moneytype == "3")
            {
                context.Response.Write(iAmount*10/9);
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}